package com.danskin.wechat.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.danskin.wechat.entity.RoleInfo;
import com.danskin.wechat.entity.UserInfo;
import com.danskin.wechat.model.AccessResponse;
import com.danskin.wechat.util.Page;

/* User实体类对应的业务操作类接口
 * @author hanwei
 * @version [版本号:1.0]
 */
public interface UserService
{
	UserInfo getUserByID(int userID);
	


	
	
	List<UserInfo> getAllUser(Page page);
	
	int updateUserByPrimaryKeySelective(Map<String,Object> map);
	
	int updatePasswordByPrimaryKeySelective(Map<String,Object> map);
	
	int insertSelective(UserInfo user);
	
	List<UserInfo> getUserListByCondtion(Page page);
	
	int deleteUserById(int id);
	
	List<UserInfo>  queryByUserName(String userName);
	
	List<RoleInfo> queryByRoleName(String roleName);
	
	UserInfo getUserByToken(String token);
	//销售端专用
	UserInfo getUserByInfoToken(String token);
	
	/**
	 * 添加角色  并给角色附菜单权限
	 * @param username
	 * @param password
	 * @param request
	 * @param response
	 * @return
	 */
	int insertRoleAndMenu(RoleInfo role,List<String> list);
	
	List<RoleInfo> getAllRoleInfoByMpId(Integer mpId);
	
	AccessResponse userLogin(String username, String password,HttpServletRequest request,HttpServletResponse response);
	
	AccessResponse userLogin(String username, String password);
	
	
}
